<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index</title>
</head>
<body>
这是首页！哈哈哈哈哈哈哈哈哈哈哈哈哈！

姓名：<input type="text" id="name" >
年龄：<input type="text" id="age">
性别：<input type="text" id="gender">
<input type="button" id="btn" value="submit" onclick="aaa()"/>
<script src="/static/jquery-3.2.1.js"></script>
<script>
    function aaa() {
        var name = $("#name").val();
        var age = $("#age").val();
        var gender = $("#gender").val();
        $.ajax({
            type:"POST",
            url:"/test/user",
            contentType : 'application/json',
            data:"{name:'"+name+"',age:'"+age+"',gender:'"+gender+"'}",
            dataType:"json",
            success:function (data) {
                alert(data.name);
            }
        })
    }
</script>

</body>
</html>